import request from "@/utils/request";
import { client } from "@/utils/client";
export const loginApi = (params: Record<string, any>) => {
  return request.post({
    url: "/login/check",
    data: {
      ...params,
      client,
    },
  });
};
export const logoutApi = () => {
  return request.post({
    url: "/login/logout",
  });
};
export const registerApi = (params: Record<string, any>) => {
  return request.post({
    url: "/login/register",
    data: {
      ...params,
      client,
    },
  });
};

//向微信请求code的链接
export function getWxCodeUrl(data: Record<string, any>) {
  return request.get({ url: "/login/code_url", data });
}
// 微信公众号登录
export function oaLoginApi(data: Record<string, any>) {
  return request.post({ url: "/login/oaLogin", data });
}
// 微信小程序登录
export function mnpLogin(data: Record<string, any>) {
  return request.post({ url: "/login/mnpLogin", data });
}

//更新微信小程序头像昵称
export function updateUser(data: Record<string, any>, header: any) {
  return request.post({ url: "/login/updateUser", data, header });
}

//小程序绑定微信
export function mnpAuthBind(data: Record<string, any>) {
  return request.post({ url: "/login/mnpAuthBind", data });
}

//公众号绑定微信
export function oaAuthBind(data: Record<string, any>) {
  return request.post({ url: "/login/oaAuthBind", data });
}
